package com.zkflzl.store.controller;

import com.zkflzl.store.common.BaseResponse;
import com.zkflzl.store.model.dto.shop.ShopAddRequest;
import com.zkflzl.store.model.dto.shop.ShopListRequest;
import com.zkflzl.store.service.ShopService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@Slf4j
@RestController
@RequestMapping("/shop")
@Api(tags = "门店模块")
public class ShopController {

    @Resource
    private ShopService shopService;
    /**
     * 添加门店
     */
    @PostMapping("/add")
    public BaseResponse addShop(@RequestBody ShopAddRequest shopAddRequest, HttpServletRequest request) {
        return shopService.addShop(shopAddRequest,request);
    }

    /**
     * 删除门店
     */
    @PostMapping("/del")
    public BaseResponse delshop(@RequestParam String shopId, HttpServletRequest request) {
        return shopService.delShop(shopId,request);
    }

    /**
     * 查询门店
     */
    @PostMapping("/sel")
    public BaseResponse selshop(@RequestBody ShopListRequest shopListRequest, HttpServletRequest request) {
        return shopService.selShop(shopListRequest,request);
    }
}



